parser grammar AnnotationLanguageParser;
options {tokenVocab=AnnotationLanguageLexer; }

prog:	START register+ ANNO stats END;
register:	OPEN framework_pattern targets? CLOSE;
framework_pattern:	framework_name (IDENTIFIERMARK temp_id)? (ONTOLOGYMARK ontology_name)?;
targets:	TARGETSOPEN target (TARGETSSPLIT target)* TARGETSCLOSE;
target:	framework_pattern DOT frame_name;
stats:	(annotation | Text)+;
annotation
	:	OPEN lexis? ONTOLOGYMARK ontology_name targets CLOSE #Ontology_annotation
	|	OPEN lexis? PROPERTYMARK property targets CLOSE	#Property_annotation
	|	OPEN lexis targets CLOSE	#Lexis_annotation
	;
temp_id:	Characters	;
framework_name:	Characters;
frame_name:	Characters;
ontology_name:	Characters;
lexis:	Characters;
property:	Characters;
